<div class="users index">
	<h2><?php echo __('Usuários');?></h2>
	<table class="table table-bordered table-striped">
	<thead>
	<tr>
			<th><?php echo $this->Paginator->sort('id');?></th>
			<th><?php echo $this->Paginator->sort('login');?></th>
			<th><?php echo $this->Paginator->sort('nome');?></th>
			<th><?php echo $this->Paginator->sort('unidade_id');?></th>
			<th><?php echo $this->Paginator->sort('admin');?></th>
			<th class="actions"><?php echo __('Actions');?></th>
	</tr>
	</thead>
	<tbody>
	<?php
	foreach ($users as $user): ?>
	<tr>
		<td><?php echo h($user['User']['id']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['login']); ?>&nbsp;</td>		
		<td><?php echo h($user['User']['nome']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($user['Unidade']['descricao'], array('controller' => 'unidades', 'action' => 'view', $user['Unidade']['id'])); ?>
		</td>
		<td>
		<?php 
			if($user['User']['admin'])
				echo 'Sim';
			else
				echo 'Não' ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link('<i class="icon-eye-open icon-white"></i>', array('action' => 'view', $user['User']['id']), array('escape' => false, 'class' => 'btn btn-primary btn-mini')); ?>
			<?php echo $this->Html->link('<i class="icon-edit icon-white"></i>', array('action' => 'edit', $user['User']['id']), array('escape' => false, 'class' => 'btn btn-primary btn-mini')); ?>
			<?php echo $this->Form->postLink('<i class="icon-trash icon-white"></i>', array('action' => 'delete', $user['User']['id']), array('escape' => false, 'class' => 'btn btn-danger btn-mini'), __('Are you sure you want to delete # %s?', $user['User']['login'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</tbody>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>

